home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 242 / 242.d81 / t.packer 1.2 < prev    next >
Text File  |  2022-08-26  |  7KB  |  243 lines

  1. u
  2.     S T A R   P A C K E R   1 . 2
  3.  
  4.     Program and Text by Lee Novak
  5.  
  6.  
  7.     What a packer does is take a file
  8. and compress the information in it,
  9. usually resulting in a smaller file.
  10. This smaller file, when later RUN,
  11. automatically "unpacks" itself back
  12. to its original state.
  13.  
  14.     The advantages of packing a
  15. program is twofold. The packed file
  16. takes up less room on a disk. Since
  17. small files load faster than large
  18. ones, your waiting time is lessened.
  19.  
  20.     LOADSTAR has generally used three
  21. compressor programs in the past, each
  22. with its pros and cons. Let's check
  23. out these programs...
  24.  
  25.     SUPERCRUNCH is a commercially
  26. available packer, meaning it cannot
  27. be published on LOADSTAR. It has the
  28. fastest packing and unpacking times,
  29. but doesn't compress files very well.
  30. Its biggest flaw is that is doesn't
  31. alter the start-of-variables pointer,
  32. causing some programs to crash.
  33.  
  34.     BIT IMPLODER is a PD cruncher
  35. that LOADSTAR published on LS #137.
  36. It has the best compression and a
  37. fancy packing screen. But, a maximum
  38. file size of 120 blocks limits what
  39. you can do with this packer. LOADSTAR
  40. may never use BIT IMPLODER again. The
  41. use of illegal op-codes makes it not
  42. compatible with the SuperCPU!
  43.  
  44.     SHIELD PACKER is a PD cruncher
  45. that LOADSTAR published on LS #147.
  46. It has second-to-best compression and
  47. can handle files large as 241 blocks!
  48. It's the hardest one to use: Half the
  49. time I can't get programs to unpack
  50. without locking up the computer. The
  51. screen also fills with garbage during
  52. unpacking, giving your program an
  53. unprofessional appearance.
  54.  
  55.  
  56.  [DRUM ROLL, PLEASE...]
  57.  [{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}]
  58.  
  59.     STAR PACKER is my entry into the
  60. shrinking world of data compression.
  61. The packer resembles the BIT IMPLODER
  62. somewhat in style, especially on the
  63. main packing screen. It can pack both
  64. regular BASIC and STAR LINKED files
  65. up to 51K (205 blocks) in size. These
  66. programs unpack very quickly without
  67. messing with the screen in any way.
  68.  
  69.     Using your new compressor is
  70. incredibly easy. When RUN, it gives
  71. you four options:
  72.  
  73. F1: Select Source Drive
  74. F3: Select Target Drive
  75. F5: Select File for Compression
  76.  B: Quit to BASIC
  77.  
  78.     Your unpacked file file loads
  79. from one drive and the packed version
  80. saves to another. F1 and F3 cycle
  81. through active drives only. It's okay
  82. if they're the same.
  83.  
  84.     This program has been OPTIMIZED
  85. for the SuperCPU, ensuring you get
  86. the fastest possible pack times. The
  87. optimization mode is turned OFF when
  88. you return to BASIC by pressing "B".
  89.  
  90.     A file requestor pops up after
  91. pressing F5. While any program up to
  92. 51K (205 blocks) can be selected, it
  93. must both LOAD and RUN from the
  94. standard BASIC address of 2049.
  95.  
  96.     Raised-BASIC programs won't work.
  97. To get around this problem, you could
  98. use STAR LINKER V3 (on issue #174) to
  99. handle the raising of BASIC, and then
  100. that linked program could be packed.
  101.  
  102.     After you select a file, you then
  103. choose the CRUNCH MODE from 1-9. The
  104. higher the number, the better the job
  105. the program does of packing, and the
  106. longer it takes to do it. Programmers
  107. are encouraged to use "9" for files
  108. they are sending to LOADSTAR.
  109.  
  110.     STAR PACKER then loads your file
  111. and begins the packing process. The
  112. program tells you the initial size of
  113. the file in bytes and disk blocks.
  114. It also keeps a running tally of the
  115. new size (which includes the unpacker
  116. code it has to add), the types of
  117. compression applied, the bytes saved
  118. by each of these methods, the elapsed
  119. time, the bytes remaining to check,
  120. and a gauge showing the same thing.
  121.  
  122.     If you've seen the BIT IMPLODER
  123. in action, you can see the impact it
  124. has had on my program. This fancy
  125. display only adds a few seconds to
  126. the total packing time. Pressing STOP
  127. would abort the packing process.
  128.  
  129.     After packing, the program asks
  130. for the save name. If the entered
  131. name already exists, you're told this
  132. and can choose again. If any other
  133. disk error occurs, you've lost your
  134. chance to save the compressed file!
  135.  
  136.     You should be able to save to
  137. another partition or subdirectory on
  138. CMD devices by including the proper
  139. prefix to the filename, just like you
  140. would if saving from direct mode. See
  141. your drive's manual for details.
  142.  
  143.     You can skip the saving portion
  144. by pressing F7. This way, you can
  145. load and pack files just to see how
  146. they come out. But don't press F7
  147. unless you mean it!
  148.  
  149.     After saving, you're allowed to
  150. go back to the main menu, return to
  151. BASIC, or take a peek at the packing
  152. statistics again. That's all!
  153.  
  154.  
  155.  [...BUT HOW GOOD IS IT?]
  156.  [{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}]
  157.  
  158.     Let's see how STAR PACKER fares
  159. against the competition. I've chosen
  160. 13 files from LOADSTAR's past for
  161. this first test: compression quality.
  162.  
  163. PROGRAM LENGTHS:       Bit Imploder{SHIFT-*}N
  164. (in blocks)       Shield Packer{SHIFT-*}N   {SHIFT--}
  165.                 Star Packer{SHIFT-*}N   {SHIFT--}   {SHIFT--}
  166.             Supercrunch{SHIFT-*}N   {SHIFT--}   {SHIFT--}   {SHIFT--}
  167.        Uncompressed{SHIFT-*}N   {SHIFT--}   {SHIFT--}   {SHIFT--}   {SHIFT--}
  168.                     {SHIFT--}   {SHIFT--}   {SHIFT--}   {SHIFT--}   {SHIFT--}
  169. B.STAR TRIP        22  20  17  17  17
  170. B.MONDO WORDO      38  32  27  27  26
  171. B.TEXT CHARTER     39  25  22  22  21
  172. B.INVEST           40  33  26  26  24
  173. B.COUPON MAKER     46  36  28  27  26
  174. B.SOLVE MYSCHESS   46  30  25  24  24
  175. B.CRYPTO RESULTS   64  47  40  39  37
  176. FIREFIGHTER        65  52  46  47  45
  177. B.FOX & HOUNDS     91  63  50  49  46
  178. MUSEUM            120 100  77  74  70
  179. QUICKSMITH        136 109  97  94   -
  180. B.RAPTOR.MOV      156 158 160 158   -
  181. B.MOUSE 2.1 MAKER 199 168 111 110   -
  182.  
  183.     See how close STAR PACKER comes
  184. to SHIELD PACKER's efficiency? The
  185. BIT IMPLODER rules the chart until
  186. it's forced to bow out at 121 blocks.
  187. And well, SUPERCRUNCH is the obvious
  188. loser in this competition.
  189.  
  190.     I didn't expect B.RAPTOR.MOV to
  191. get any smaller since it was already
  192. packed. It was fun to try, though.
  193.  
  194.     Compression quality doesn't mean
  195. a lot unless you allow the computer
  196. the time to compress the file! This
  197. second test is the time taken to pack
  198. files of 39, 65, 91, and 120 blocks,
  199. with and without the SuperCPU.
  200.  
  201. PACKING TIMES:          Supercrunch{SHIFT-*}N
  202. (min/sec)         Star Packer{SHIFT-*}N     {SHIFT--}
  203.            Bit Imploder{SHIFT-*}N     {SHIFT--}     {SHIFT--}
  204.     Shield Packer{SHIFT-*}N     {SHIFT--}     {SHIFT--}     {SHIFT--}
  205.                   {SHIFT--}     {SHIFT--}     {SHIFT--}     {SHIFT--}
  206. -STOCK CPU-       {SHIFT--}     {SHIFT--}     {SHIFT--}     {SHIFT--}
  207. text charter   4:33  3:17  3:20  0:27
  208. firefighter   18:14 12:28 12:48  1:02
  209. fox & hounds  21:55 16:34 16:30  1:05
  210. museum        41:15 32:03 31:45  1:30
  211.                   {SHIFT--}     {SHIFT--}     {SHIFT--}     {SHIFT--}
  212. -SUPER CPU-       {SHIFT--}     {SHIFT--}     {SHIFT--}     {SHIFT--}
  213. text charter   0:15  0:11  0:09  0:03
  214. firefighter    1:00  0:39  0:37  0:06
  215. fox & hounds   1:18  0:53  0:47  0:06
  216. museum         2:23  1:40  1:31  0:11
  217.                   {SHIFT--}     {SHIFT--}     {SHIFT--}     {SHIFT--}
  218. SCPU speed-up:  17x   19x   21x    9x
  219.  
  220.     SUPERCRUNCH wins the speed test,
  221. hands down! The other three packers
  222. take a lot more time, but manage to
  223. squeeze out a lot more bytes, too.
  224.  
  225.     The last statistic to throw at
  226. you is the speed at which these files
  227. unpack at RUN-time. The following are
  228. crude estimates of the time needed to
  229. unpack an originally 136-block file:
  230.  
  231. Supercrunch   1.5 secs  (91 blks/sec)
  232. Star Packer   2.0 secs  (68 blks/sec)
  233. Bit Imploder  5.0 secs  (27 blks/sec)
  234. Shield Packer 6.0 secs  (23 blks/sec)
  235.  
  236.     Remember, this is for unpacking
  237. the file only. STAR LINKED files need
  238. to unlink afterwards, which can take
  239. up to eight seconds on a stock CPU.
  240.  
  241.  LN
  242.  
  243.  
  244.